import random
class common_img:
    def __init__(self,webd):
        webd.implicitly_wait(2)
        webd.switch_to_frame(webd.find_element_by_name('Openupimg_dialog'))
        webd.find_element_by_xpath('/html/body/div[2]/ul/li[2]').click()
        img = webd.find_elements_by_xpath('//li/img')
        index = random.choice(img)
        index.click()
        webd.find_element_by_class_name('button').click()
        webd.switch_to_default_content()